
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>6.事件循环 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.html" />
    
    
    <link rel="prev" href="5zhong-zi-guan-li-qi.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    序言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    1. 快速入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="2ji-ben-zu-jian.html">
            
                <a href="2ji-ben-zu-jian.html">
            
                    
                    2.基本组件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="2ji-ben-zu-jian/processor.html">
            
                <a href="2ji-ben-zu-jian/processor.html">
            
                    
                    2.1 Processor
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="2ji-ben-zu-jian/22-pipline.html">
            
                <a href="2ji-ben-zu-jian/22-pipline.html">
            
                    
                    2.2 Pipline
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="2ji-ben-zu-jian/23-sessionpool.html">
            
                <a href="2ji-ben-zu-jian/23-sessionpool.html">
            
                    
                    2.3 SessionPool
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="3pa-chong-kong-zhi.html">
            
                <a href="3pa-chong-kong-zhi.html">
            
                    
                    3.爬虫控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="4chou-qu-qi.html">
            
                <a href="4chou-qu-qi.html">
            
                    
                    4.抽取器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="4chou-qu-qi/41sipsoup.html">
            
                <a href="4chou-qu-qi/41sipsoup.html">
            
                    
                    4.1SipSoup
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="4chou-qu-qi/42tableevaluator.html">
            
                <a href="4chou-qu-qi/42tableevaluator.html">
            
                    
                    4.2TableEvaluator
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="5zhong-zi-guan-li-qi.html">
            
                <a href="5zhong-zi-guan-li-qi.html">
            
                    
                    5.种子管理器
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.7" data-path="6shi-jian-xun-huan.html">
            
                <a href="6shi-jian-xun-huan.html">
            
                    
                    6.事件循环
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.html">
            
                <a href="6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.html">
            
                    
                    6.1 eventLoop工作机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="6shi-jian-xun-huan/62zi-dong-shi-jian.html">
            
                <a href="6shi-jian-xun-huan/62zi-dong-shi-jian.html">
            
                    
                    6.2 自动事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="6shi-jian-xun-huan/63delayevent.html">
            
                <a href="6shi-jian-xun-huan/63delayevent.html">
            
                    
                    6.3 延时事件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="6shi-jian-xun-huan/64classScanner.html">
            
                <a href="6shi-jian-xun-huan/64classScanner.html">
            
                    
                    6.4 classScanner
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >6.事件循环</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x524D;&#x51E0;&#x4E2A;&#x7AE0;&#x8282;&#x4E00;&#x76F4;&#x6709;&#x63D0;&#x5230;&#x8FC7;&#x4E8B;&#x4EF6;&#x5FAA;&#x73AF;&#x673A;&#x5236;&#xFF0C;&#x4F46;&#x662F;&#x90FD;&#x662F;&#x5927;&#x81F4;&#x4F7F;&#x7528;&#x4E86;&#x4E00;&#x4E0B;&#xFF0C;&#x6CA1;&#x6709;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD;&#x4E8B;&#x4EF6;&#x5FAA;&#x73AF;&#x673A;&#x5236;&#x3002;&#x5B9E;&#x9645;&#x4E0A;VS&#x5185;&#x90E8;&#x5927;&#x91CF;&#x4F7F;&#x7528;EventLoop&#xFF0C;&#x57FA;&#x4E8E;&#x4ED6;&#x53EF;&#x4EE5;&#x5F88;&#x968F;&#x610F;&#x7684;&#x8DE8;&#x7EC4;&#x4EF6;&#x901A;&#x4FE1;&#x3002;&#x800C;&#x4E14;&#x4E8B;&#x4EF6;&#x5FAA;&#x73AF;&#x672C;&#x8EAB;&#x5C31;&#x662F;MQ&#x7684;&#x6A21;&#x578B;&#xFF0C;&#x6269;&#x5C55;&#x6027;&#x5F88;&#x5F3A;&#xFF0C;&#x540C;&#x65F6;&#x6D88;&#x606F;&#x53D1;&#x9001;&#x65B9;&#x63A5;&#x6536;&#x65B9;&#x90FD;&#x662F;&#x53EF;&#x62C6;&#x5378;&#x7684;&#xFF0C;&#x8026;&#x5408;&#x6027;&#x5F88;&#x4F4E;&#x3002;</p>
<p>&#x8BBE;&#x8BA1;EventLoop&#x4E4B;&#x524D;&#xFF0C;&#x8003;&#x8651;&#x8FC7;guava&#x7684;eventbus&#xFF0C;&#x4F46;&#x662F;&#x6211;&#x53D1;&#x73B0;&#x770B;&#x4E0D;&#x61C2;&#x3002;&#x6240;&#x4EE5;&#x4E00;&#x6012;&#x4E4B;&#x4E0B;&#x4ECE;&#x5934;&#x5F00;&#x59CB;&#x5199;&#x3002;EventLoop&#x5C31;&#x662F;&#x7EF4;&#x62A4;&#x4E86;&#x4E00;&#x4E2A;&#x961F;&#x5217;&#xFF0C;&#x7136;&#x540E;&#x6709;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x5FAA;&#x73AF;&#x53D6;&#x51FA;&#x961F;&#x5217;&#x91CC;&#x9762;&#x7684;event&#x5BF9;&#x8C61;&#xFF0C;&#x9009;&#x62E9;event&#x7684;&#x5904;&#x7406;&#x5668;&#xFF0C;&#x56DE;&#x8C03;event&#x6BCF;&#x4E2A;&#x5904;&#x7406;&#x5668;&#x3002;&#x6240;&#x4EE5;EventLoop&#x5141;&#x8BB8;&#x53D1;&#x9001;&#x5EF6;&#x65F6;&#x4E8B;&#x4EF6;&#xFF0C;&#x8FD9;&#x65F6;&#x56E0;&#x4E3A;&#x4ED6;&#x672C;&#x8EAB;&#x6709;&#x4E00;&#x4E2A;&#x76D1;&#x542C;&#x7EBF;&#x7A0B;&#x7684;&#x3002;&#x540C;&#x65F6;&#xFF0C;EventLoop&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x7EBF;&#x7A0B;&#x5DE5;&#x4F5C;&#xFF0C;&#x4E8B;&#x4EF6;&#x5904;&#x7406;&#x5668;&#x903B;&#x8F91;&#x4E2D;&#x4E0D;&#x5141;&#x8BB8;&#x8FDB;&#x884C;&#x8017;&#x65F6;&#x64CD;&#x4F5C;&#xFF0C;&#x5982;&#x679C;&#x786E;&#x5B9E;&#x9700;&#x8981;&#xFF0C;&#x8003;&#x8651;&#x4F7F;&#x7528;&#x4E8B;&#x4EF6;&#x6295;&#x9012;&#x672C;&#x8EAB;&#x7EBF;&#x7A0B;&#xFF0C;&#x6295;&#x9012;&#x540C;&#x6B65;&#x4E8B;&#x4EF6;&#x3002;&#x6216;&#x8005;&#x5F02;&#x6B65;&#x4E8B;&#x4EF6;&#x4E2D;&#xFF0C;&#x542F;&#x52A8;&#x65B0;&#x7EBF;&#x7A0B;&#x5904;&#x7406;&#x8017;&#x65F6;&#x903B;&#x8F91;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="5zhong-zi-guan-li-qi.html" class="navigation navigation-prev " aria-label="Previous page: 5.种子管理器">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.html" class="navigation navigation-next " aria-label="Next page: 6.1 eventLoop工作机制">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"6.事件循环","level":"1.7","depth":1,"next":{"title":"6.1 eventLoop工作机制","level":"1.7.1","depth":2,"path":"6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.md","ref":"6shi-jian-xun-huan/61-eventloopgong-zuo-ji-zhi.md","articles":[]},"previous":{"title":"5.种子管理器","level":"1.6","depth":1,"path":"5zhong-zi-guan-li-qi.md","ref":"5zhong-zi-guan-li-qi.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"6shi-jian-xun-huan.md","mtime":"2017-06-25T02:24:52.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-06-25T14:04:12.299Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

